package com.erp.order.purchasing.model;

import com.erp.hr.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.List;

/**
 * 采购订单 实体类
 * @Author: syz
 * @blame syz
 * @CreateTime: 2021/4/6
 */
@Data
@Entity
@DynamicInsert()
@DynamicUpdate()
@EqualsAndHashCode(callSuper = true)
@Table(name="purchase_order", schema="erp")
public class PurchaseOrder extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 询价单id
     */
    @Column(name = "inquiry_list_id")
    private Long inquiryListId;

    /**
     * 编号
     */
    @Column(name = "code")
    private String code;

    /**
     * 供应商id
     */
    @Column(name = "supplier_id")
    private Integer supplierId;

    /**
     * 供应商名称
     */
    @Column(name = "supplier_name")
    private String supplierName;

    /**
     * 公司名称
     */
    @Column(name = "company_name")
    private String companyName;

    /**
     * 联系人
     */
    @Column(name = "linkman")
    private String linkman;

    /**
     * 联系电话
     */
    @Column(name = "tel")
    private String tel;

    /**
     * 开始收货时间
     */
    @Column(name = "begin_date")
    private String beginDate;

    /**
     * 结束收货时间
     */
    @Column(name = "end_date")
    private String endDate;

    /**
     * 收货地址
     */
    @Column(name = "address")
    private String address;

    /**
     * 已付金额
     */
    @Column(name = "amount_paid")
    private BigDecimal amountPaid;

    /**
     * 总金额
     */
    @Column(name = "total_money")
    private BigDecimal totalMoney;

    /**
     * 状态
     */
    @Column(name = "status")
    private String status;

    /**
     * 物资集合
     */
    @Transient
    private List<PurchasingRequisitionDetail> subs;

}